import React, { Component } from 'react';
import { View, Text, Alert } from 'react-native';
import { Actions } from 'react-native-router-flux';
import styles from './styles';
import Header from './components/header';
import PasswordForm from './components/passwordForm';

export default class LoginWithPassword extends Component {
  submitHandle = values => {
    Alert.alert('表单值', JSON.stringify(values), [{ text: '知道了' }], {
      cancelable: false
    });
    Actions.loginWithPassword()
  };
  render() {
    return (
      <View>
        <Header
          title="设置密码"
        />
        <View style={styles.content}>
          <PasswordForm
            onSubmit={this.submitHandle}
            submitText="提交"
          />
        </View>
      </View>
    );
  }
}
